<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div>{{getInfo()}}</div>
        <div>{{getInfo()}}</div>
        <div>{{getInfo()}}</div>
        <hr>
        <div>{{getStudent}}</div>
        <div>{{getStudent}}</div>
        <div>{{getStudent}}</div>
    </div>
    <!-- <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> -->
    <script src="../assets/vue3.js"></script>
    <script>
        const app = Vue.createApp({
            data() {
                return {
                    student: { id: 1, name: '张三', age: 22, gender: 1 }
                }
            },
            methods: {
                getInfo() {
                    console.log('into method')
                    return `${this.student.id}.${this.student.name}-${this.student.age}-${this.student.gender == 1 ? '男' : '女'}`;
                }
            },
            computed: {
                getStudent() {
                    console.log('into computed')
                    return `${this.student.id}.${this.student.name}-${this.student.age}-${this.student.gender == 1 ? '男' : '女'}`;
                }
            },
        });
        app.mount('#app');
    </script>
</body>

</html>